@extends('../manage.layout')
@section('content')
    <!-- Content Header (Page header) -->
    <section class="content-header">
        <h1>
            系统管理
            <small>更改管理员信息</small>
        </h1>
        <ol class="breadcrumb">
            <li><a href="/manage"><i class="fa fa-dashboard"></i>首页</a></li>
            <li class="active">更改管理员信息</li>
        </ol>
    </section>
    <!-- Main content -->
    <section class="content animated fadeInRight">
        <div class="row">
            <div class="col-md-12">
                <!-- general form elements -->
                <div class="box-body table-responsive no-padding">
                    <div class="box box-primary">
                        <div class="box-header with-border">
                            <h3 class="box-title">{{ $user['username'] }}</h3>
                        </div>
                        <!-- /.box-header -->
                        <!-- form start -->
                        <form action="/manage/user/update/{{$user['id']}}" method="post">
                            {{--{{ method_field('PUT') }}--}}
                            {{ csrf_field() }}
                            <input type="hidden" name="user_id" id="user_id" value="{{ session('user.id') }}">
                            <div class="form-group">
                                <label for="role_id">选择角色</label>
                                <select class="form-control" name="role_id" id="role_id">
                                    @foreach($role as $v)
                                        <option value="{{$v->id}}" @if($v->id == $user['role_id'])selected="selected"@endif>{{$v->name}}</option>
                                    @endforeach
                                </select>
                            </div>
                            <div class="box-body">
                                <div class="form-group">
                                    <label for="username">用户名</label>
                                    <input type="text" class="form-control" id="username" name="username" value="{{ $user['username'] }}" required="required">
                                </div>
                                <div class="form-group">
                                    <label for="email">邮箱</label>
                                    <input type="email" class="form-control" id="email" name="email" value="{{ $user['email'] }}">
                                </div>
                                <div class="form-group">
                                    <label for="password">密码</label>
                                    <input type="password" class="form-control" id="password" name="password" placeholder="新密码">
                                </div>
                            </div>
                            <!-- /.box-body -->
                            <div class="box-footer">
                                <button type="submit" class="btn btn-primary">确定</button>&nbsp;&nbsp;<span class="btn btn-primary" onclick="window.location.href='/manage/user'">返回</span>
                            </div>
                         </form>
                    </div>
                </div>
            </div>
        </div>
    </section>
    <!-- /.content -->
@endsection
@section('script')

@endsection

